<div class="row toolbar">
  <div class="col-md-6">
    <span class="toolbar-header">
      <%= @contact_type.new_record? ? "#{t(:new_address_type)}" : "#{t(:edit)} #{(:address_type)}" %> 
    </span>
  </div>
  <div class="col-md-6 text-right">
    <ul class="toolbar-nav">
      <li><% link_to simple_icon("user"), @contact_type %></li>
      <li>
      <%= link_to simple_icon("user"), 
        if params.has_key?(:patient_id)
			new_patient_contact_path(:patient_id => params[:patient_id])
    	else
    		 new_staff_contact_path(:staff_id => params[:staff_id])
		end 
       %>
       </li>
    </ul>
  </div>
</div>

<%= form_for(@contact_type , url:
		if params.has_key?(:patient_id)
			patient_contact_types_path
		else
			staff_contact_types_path
		end
) do |f| %>
  <% if @contact_type.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@contact_type.errors.count, "error") %> prohibited this contact_type from being saved:</h2>

      <ul>
      <% @contact_type.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="form-group">
    <%= f.label :label %><br>
    <%= f.text_field :label %>
  </div>
  
  <%= f.submit class: "btn btn-primary" %>
<% end %>
